package ch.hearc.coursJava.moo.interfaces.base;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class GirafeTest
	{

	/*------------------------------------------------------------------*\
	 |*							Constructeurs							*|
	 \*------------------------------------------------------------------*/

	@Before
	public void before()
		{
		// rien
		}

	@After
	public void after()
		{
		// rien
		}

	/*------------------------------------------------------------------*\
	 |*							Methodes Public							*|
	 \*-----------------------------------------------------------------*/

	@Test
	public void testClone()
		{
		Girafe gSource = new Girafe(18,SexesType.MASCULIN);
		Girafe gClone = gSource.cloneOf();
		assertTrue(gClone.isEgal(gSource));
		gSource.setSexeType(SexesType.FEMININ);
		assertTrue(!gSource.isEgal(gClone));
		assertTrue(gSource.getSexeType() == SexesType.FEMININ);
		assertTrue(gClone.getSexeType() == SexesType.MASCULIN);
		}

	@Test
	public void testisEgal()
		{
		Girafe g1m = new Girafe(1,SexesType.MASCULIN);
		Girafe g2m = new Girafe(2,SexesType.MASCULIN);

		Girafe g1f = new Girafe(1,SexesType.FEMININ);
		Girafe g2f = new Girafe(2,SexesType.FEMININ);

		Girafe g1mBis = new Girafe(1,SexesType.MASCULIN);
		assertFalse(g1m.isEgal(g2m));
		assertFalse(g1f.isEgal(g2f));
		assertFalse(g1m.isEgal(g1f));
		assertFalse(g2m.isEgal(g2f));
		assertTrue(g1m.isEgal(g1mBis));
		assertTrue(g1mBis.isEgal(g1m)==g1m.isEgal(g1mBis));
		assertTrue(g1mBis.isEgal(g2m)==g2m.isEgal(g1mBis));
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	}
